﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace Tomahawk.Runtime.Canvas.Sprite
{
    public class UISpriteRenderer : SpriteRenderer
    {
        /// <summary>
        /// Rendering the UI Sprites
        /// </summary>
        public override void Render()
        {
            //Prepare the sprite batch
            spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.None);

            //render all uisprites
            foreach (Sprite sprite in this.sprites)
            {
                if (sprite.Visible)
                {
                    sprite.Render(this.spriteBatch);
                }
            }

            //end the spritebatch
            spriteBatch.End();
        }

    }
}
